<?php
/**
 * XmuSlh, web platform of Student Association Federation of Xiamen University
 * 
 * Rewritting one or some pages of StatusNet. 
 * To get the original version, please visit <http://status.net/>.
 * 
 * StatusNet, the distributed open-source microblogging tool
 * 
 * LICENCE: This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Addphotonews action form.
 * Just a button that displayed near the 'addphoto' form, pressing it
 * to update the news of photoset!
 * 
 * 添加相册新鲜事的表格.对话框吧.
 * 动态显示的!在添加完相关的图片后才出现唉.
 * 
 * @author		ytukie <ytukie@gmail.com>
 * @version		0.1
 */

// XmuSlh only.
if ( !defined('XMUSLH')) { exit(1); }

// Requirements.
require_once INSTALLDIR . '/lib/slh_util.php';
require_once INSTALLDIR . '/lib/slh_form.php';


class AddphotonewsForm extends Form
{
	/**
	 * ID of the from
	 */
	function id()
	{
		return 'id_form_addphotonews';
	}
	
	/**
	 * Class of the form.
	 */
	/*
	function formClass()
	{
		return 'form_settings';
	}
	*/
	
	/**
	 * Action of the form
	 * 
	 * Return the string URL of the action.
	 */
	function action()
	{
		return slh_action2url('addphotonews');
	}
	
	/**
	 * Name of the form
	 */
	function formLegend()
	{
		$this->out->element('legend', null, 'add photo news');
	}
	
	/**
	 * Token of the form.
	 */
	function formToken()
	{
		$this->out->hidden('formtoken', 'addphotonews');
	}
	
	/**
	 * Data elements.
	 */
	function formData()
	{
		// Just a hidden!
		// The photoset_id
		$this->out->hidden('pphotoset_id', $this->getField('gphotoset_id'));
	}
	
	/**
	 * Action elements.
	 */
	function formActions()
	{
		$this->out->elementStart('div', 'formaction');
		$this->out->submit('submit_goback',
						   '完成返回',
						   'submit',
						   'submit',
						   '完成添加图片.');
		$this->out->text(' ');
		$this->out->submit('submit_addnews',
						   '添加新鲜事',
						   'submit',
						   'submit',
						   '完成添加图片并且发布新鲜事.');
		$this->out->elementEnd('div');
	}
}